package com.itheima.arithmeticoperator;

public class ArithmeticoperatorDemo6 {
    public static void main(String[] args) {
        int x = 10;
        //后++：先用后加
        //把x中的值赋给变量y，再自增
        //赋值给变量y的值是自增前的
        int y = x++;// x = 11 y = 10
        //先++：先加后用
        //先把x进行自增，然后把自增后的结果赋给左边的变量
        int z = ++x;// x = 12 z = 12
        System.out.println("x:" + x);//12
        System.out.println("y:" + y);//10
        System.out.println("z:" + z);//12
    }
}
